package New;


import java.util.regex.Pattern;

/**
 * 判断字符串是否是数字
 */
public class Lix {
    public static void main(String[] args) {
//        System.out.println(isNumberAscii("22"));
        System.out.println(3&1);//1与运算，同为同，异为0
        System.out.println(3^1);//2异或运算，同为0，异为1
       k:
        for (int i = 0; i < 5; i++) {
            for (int j = 0;j<10;j++){
                System.out.println(i+"j"+j);
                if (j==5)
                    break k ;
            }
        }
    }

    public static boolean isNumber(String str){

        for (int i = 0; i <str.length(); i++) {

            if (!Character.isDigit(str.charAt(i))){

                return false;
            }
        }
        return true;
    }
    public static  boolean isInteger(String str){
        Pattern pattern = Pattern.compile("^[-\\+]?[\\d]*$");//?前面匹配1次或0次-，表示负数或正数
        return pattern.matcher(str).matches();
    }
    public static boolean isNumberAscii(String str){
        for (int  i =str.length(); --i>=0;) {
            int chr = str.charAt(i);
            if (chr<48 || chr>57)
                return false;
        }
        return true;
    }
}
